package interfaz;

import javax.swing.JPanel;
import java.awt.Color;
import java.awt.GridBagLayout;
import javax.swing.JLabel;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JRadioButton;
import javax.swing.JTextField;

import componentes.Competencia;
import componentes.Usuario;
import javax.swing.JButton;

public class gestionarRtdoSets extends JPanel {

	private JButton btnGuardar;
	private JButton btnCancelar;
	private JTextField textField;
	private JTextField textField_1;
	private JTextField textField_2;
	private JTextField textField_3;
	private JTextField textField_4;
	private JTextField textField_5;
	private JTextField textField_6;
	private JTextField textField_7;
	private JTextField textField_8;
	private JTextField textField_9;
	private JTextField textField_10;
	private JTextField textField_11;
	
	/**
	 * Create the panel.
	 * @param competencia 
	 * @param pantallaInicialUserReg 
	 * @param usuarioLogueado 
	 * @param panelAnterior 
	 * @param panelPrincipal 
	 */
	public gestionarRtdoSets(Competencia competencia, JPanel panelAnterior, JPanel panelPrincipal, Usuario usuarioLogueado, PantallaInicialUserReg pantallaInicialUserReg) {
	setBackground(new Color(255, 165, 0));
		GridBagLayout gridBagLayout = new GridBagLayout();
		gridBagLayout.columnWidths = new int[]{0, 71, 82, 75, 67, 0, 41, 34, 150, 103, 0, 0, 0};
		gridBagLayout.rowHeights = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0};
		gridBagLayout.columnWeights = new double[]{0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
		gridBagLayout.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
		setLayout(gridBagLayout);
		
		JLabel lblGestionarResultado = new JLabel("Gestionar Resultado");
		GridBagConstraints gbc_lblGestionarResultado = new GridBagConstraints();
		gbc_lblGestionarResultado.insets = new Insets(0, 0, 5, 5);
		gbc_lblGestionarResultado.gridx = 0;
		gbc_lblGestionarResultado.gridy = 0;
		add(lblGestionarResultado, gbc_lblGestionarResultado);
		
		JLabel lblParticipanteAusente = new JLabel("Participante Ausente:");
		GridBagConstraints gbc_lblParticipanteAusente = new GridBagConstraints();
		gbc_lblParticipanteAusente.insets = new Insets(0, 0, 5, 5);
		gbc_lblParticipanteAusente.gridx = 0;
		gbc_lblParticipanteAusente.gridy = 1;
		add(lblParticipanteAusente, gbc_lblParticipanteAusente);
		
		JRadioButton rdbtnEquipo = new JRadioButton("Equipo 1");
		rdbtnEquipo.setBackground(new Color(255, 165, 0));
		GridBagConstraints gbc_rdbtnEquipo = new GridBagConstraints();
		gbc_rdbtnEquipo.insets = new Insets(0, 0, 5, 5);
		gbc_rdbtnEquipo.gridx = 1;
		gbc_rdbtnEquipo.gridy = 1;
		add(rdbtnEquipo, gbc_rdbtnEquipo);
		
		JRadioButton rdbtnEquipo_1 = new JRadioButton("Equipo 2");
		rdbtnEquipo_1.setBackground(new Color(255, 165, 0));
		GridBagConstraints gbc_rdbtnEquipo_1 = new GridBagConstraints();
		gbc_rdbtnEquipo_1.insets = new Insets(0, 0, 5, 5);
		gbc_rdbtnEquipo_1.gridx = 2;
		gbc_rdbtnEquipo_1.gridy = 1;
		add(rdbtnEquipo_1, gbc_rdbtnEquipo_1);
		
		JLabel lblResultado = new JLabel("Resultado:");
		GridBagConstraints gbc_lblResultado = new GridBagConstraints();
		gbc_lblResultado.anchor = GridBagConstraints.EAST;
		gbc_lblResultado.insets = new Insets(0, 0, 5, 5);
		gbc_lblResultado.gridx = 0;
		gbc_lblResultado.gridy = 2;
		add(lblResultado, gbc_lblResultado);
		
		textField = new JTextField();
		GridBagConstraints gbc_textField = new GridBagConstraints();
		gbc_textField.insets = new Insets(0, 0, 5, 5);
		gbc_textField.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField.gridx = 1;
		gbc_textField.gridy = 2;
		add(textField, gbc_textField);
		textField.setColumns(10);
		
		textField_2 = new JTextField();
		GridBagConstraints gbc_textField_2 = new GridBagConstraints();
		gbc_textField_2.insets = new Insets(0, 0, 5, 5);
		gbc_textField_2.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_2.gridx = 2;
		gbc_textField_2.gridy = 2;
		add(textField_2, gbc_textField_2);
		textField_2.setColumns(10);
		
		textField_6 = new JTextField();
		GridBagConstraints gbc_textField_6 = new GridBagConstraints();
		gbc_textField_6.insets = new Insets(0, 0, 5, 5);
		gbc_textField_6.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_6.gridx = 3;
		gbc_textField_6.gridy = 2;
		add(textField_6, gbc_textField_6);
		textField_6.setColumns(10);
		
		textField_8 = new JTextField();
		GridBagConstraints gbc_textField_8 = new GridBagConstraints();
		gbc_textField_8.insets = new Insets(0, 0, 5, 5);
		gbc_textField_8.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_8.gridx = 4;
		gbc_textField_8.gridy = 2;
		add(textField_8, gbc_textField_8);
		textField_8.setColumns(10);
		
		textField_11 = new JTextField();
		GridBagConstraints gbc_textField_11 = new GridBagConstraints();
		gbc_textField_11.insets = new Insets(0, 0, 5, 5);
		gbc_textField_11.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_11.gridx = 5;
		gbc_textField_11.gridy = 2;
		add(textField_11, gbc_textField_11);
		textField_11.setColumns(10);
		
		textField_4 = new JTextField();
		GridBagConstraints gbc_textField_4 = new GridBagConstraints();
		gbc_textField_4.insets = new Insets(0, 0, 5, 5);
		gbc_textField_4.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_4.gridx = 6;
		gbc_textField_4.gridy = 2;
		add(textField_4, gbc_textField_4);
		textField_4.setColumns(10);
		
		textField_7 = new JTextField();
		GridBagConstraints gbc_textField_7 = new GridBagConstraints();
		gbc_textField_7.insets = new Insets(0, 0, 5, 5);
		gbc_textField_7.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_7.gridx = 7;
		gbc_textField_7.gridy = 2;
		add(textField_7, gbc_textField_7);
		textField_7.setColumns(10);
		
		textField_1 = new JTextField();
		GridBagConstraints gbc_textField_1 = new GridBagConstraints();
		gbc_textField_1.insets = new Insets(0, 0, 5, 5);
		gbc_textField_1.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_1.gridx = 1;
		gbc_textField_1.gridy = 3;
		add(textField_1, gbc_textField_1);
		textField_1.setColumns(10);
		
		textField_3 = new JTextField();
		GridBagConstraints gbc_textField_3 = new GridBagConstraints();
		gbc_textField_3.insets = new Insets(0, 0, 5, 5);
		gbc_textField_3.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_3.gridx = 2;
		gbc_textField_3.gridy = 3;
		add(textField_3, gbc_textField_3);
		textField_3.setColumns(10);
		
		textField_5 = new JTextField();
		GridBagConstraints gbc_textField_5 = new GridBagConstraints();
		gbc_textField_5.insets = new Insets(0, 0, 5, 5);
		gbc_textField_5.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_5.gridx = 3;
		gbc_textField_5.gridy = 3;
		add(textField_5, gbc_textField_5);
		textField_5.setColumns(10);
		
		textField_9 = new JTextField();
		GridBagConstraints gbc_textField_9 = new GridBagConstraints();
		gbc_textField_9.insets = new Insets(0, 0, 5, 5);
		gbc_textField_9.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_9.gridx = 4;
		gbc_textField_9.gridy = 3;
		add(textField_9, gbc_textField_9);
		textField_9.setColumns(10);
		
		textField_10 = new JTextField();
		GridBagConstraints gbc_textField_10 = new GridBagConstraints();
		gbc_textField_10.insets = new Insets(0, 0, 5, 5);
		gbc_textField_10.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_10.gridx = 7;
		gbc_textField_10.gridy = 3;
		add(textField_10, gbc_textField_10);
		textField_10.setColumns(10);
		
		btnGuardar = new JButton("Guardar");
		GridBagConstraints gbc_btnAceptar = new GridBagConstraints();
		gbc_btnAceptar.insets = new Insets(0, 0, 0, 5);
		gbc_btnAceptar.gridx = 1;
		gbc_btnAceptar.gridy = 7;
		add(btnGuardar, gbc_btnAceptar);
		
		btnCancelar = new JButton("Cancelar");
		GridBagConstraints gbc_btnCancelar = new GridBagConstraints();
		gbc_btnCancelar.insets = new Insets(0, 0, 0, 5);
		gbc_btnCancelar.gridx = 2;
		gbc_btnCancelar.gridy = 7;
		add(btnCancelar, gbc_btnCancelar);

		inicializar(competencia, panelAnterior, panelPrincipal, usuarioLogueado, pantallaInicialUserReg);
		
		
	}
		public void inicializar(Competencia competencia, final JPanel panelAnterior, JPanel panelPrincipal, final Usuario usuarioLogueado, final PantallaInicialUserReg pantallaInicialUserReg){
		

			btnGuardar.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					setVisible(false);
					panelAnterior.setVisible(true);
				}
			});

			btnCancelar.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					setVisible(false);
					panelAnterior.setVisible(true);
				}
			});
			
	}
	
	}


